package com.example.bt.controller;

import com.example.bt.dto.UserDto;
import com.example.bt.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description: 用户控制层
 * @author: WangBlue
 * @create: 2024-03-06 18:18
 **/
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;


    @GetMapping("")
    public List<UserDto> getAll(){
        List<UserDto> allUser = userService.getUserTree();
        System.out.println(allUser);
        return allUser;
    }
}
